# *-* coding:utf8 *-*
from flask import session

# flask_migrate 扩展实现数据库迁移
from flask_migrate import Migrate, MigrateCommand

# flask_script 扩展实现命令行管理
from flask_script import Manager
from info import create_app, db

app = create_app("development")

# 集成flash-script配置数据库迁移与终端部署功能
manager = Manager(app)
# 将app与db关联
Migrate(app, db)
# 配置数据库迁移
manager.add_command("db", MigrateCommand)


@app.route('/')
def index():
    # session["name"] = "xw"
    return "hello world"


def main():
    manager.run()


if __name__ == "__main__":
    main()
